{{template "header"}}
      <title>Topic - HackerZ 的博客</title>
    </head>
  
  <body>
    <div class="navbar navbar-default navbar-fixed-top">
      <div class="container">
        {{template "navbar" .}}
      </div>  
    </div>
    
    <div class="container">
      <h1>Topic List</h1>
      <a href="/topic/add" class="btn btn-default">Add Topic</a>
      <table class="table table-striped">
        <thead>
          <tr>
            <th>#</th>
            <th>Topic Name</th>
            <th>Last Update</th>
            <th>View Count</th>
            <th>Comment Count</th>
            <th>The Last Comment Time</th>
            <th>Operation</th>
          </tr>
        </thead>
        <tbody>
          {{range .Topics}}
          <tr>
            <th>{{.Id}}</th>
            <th><a href="/topic/view/{{.Id}}">{{.Title}}</a></th>
            <th>{{dateformat .Updated "2006-01-02 15:04:05"}}</th>
            <th>{{.Views}}</th>
            <th>{{.ReplyCount}}</th>
            <th>{{dateformat .ReplyTime "2006-01-02 15:04:05"}}</th>
            <th>
              <a href="/topic/modify?tid={{.Id}}">Edit</a>
              <a href="/topic/delete?tid={{.Id}}" onclick="javascript:return confirm('确定要删除吗？')">Delete</a>
            </th>
          </tr>
          {{end}}
        </tbody>
      </table>
    </div>

    <script type="text/javascript" src="http://cdn.staticfile.org/jquery/2.1.1-rc2/jquery.min.js"></script>
    <script type="text/javascript" src="/static/js/bootstrap.min.js"></script>
  </body>
</html>
